/**
 * 图书管理系统-入口文件
 */
const express = require('express');
const path = require('path');
const router = require('./router.js');
const template = require('art-template');
const bodyParser = require('body-parser');
const app = express();

app.use('/www', express.static('public'));

// (API) : http://www.expressjs.com.cn/4x/api.html#req.body
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded

// 模板引擎的“路径”
app.set('views', path.join(__dirname, 'views'));
// 模板引擎的“后缀”
app.set('view engine', 'art');
// 兼容的包
app.engine('art', require('express-art-template'));

app.use(router);
app.listen(3000, ()=>{
    console.log('running...');
});











